<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <style>
        .layui-form-label {
            width: 85px;
        }
        .layui-input-block {
            margin-left: 115px;
        }
    </style>
</head>
<body style="padding: 15px;">
<form class="layui-form" action="javascript:void(0);">
    <input type="hidden" name="id" value="{$info.id}">
    <div class="layui-form-item">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-block">
            <input type="text" name="student" required value="{$info.student}" lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="password" name="password" placeholder="请输入密码，不填则不修改" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">身份证</label>
        <div class="layui-input-block">
            <input type="text" name="uuid" placeholder="请输入身份证" value="{$info.uuid}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">学号</label>
        <div class="layui-input-block">
            <input type="text" name="serial" placeholder="请输入学号" value="{$info.serial}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">班级</label>
        <div class="layui-input-block">
            <input type="text" name="classes" placeholder="请输入班级" value="{$info.classes}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-block">
            <input type="text" name="phone" placeholder="请输入联系电话" value="{$info.phone}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">家庭联系地址</label>
        <div class="layui-input-block">
            <input type="text" name="address" placeholder="请输入家庭联系地址" value="{$info.address}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">监护人</label>
        <div class="layui-input-block">
            <input type="text" name="guardian" placeholder="请输入监护人" value="{$info.guardian}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="0" title="上课中" {if $info.status == 0}checked{/if}>
            <input type="radio" name="status" value="1" title="休息中" {if $info.status == 1}checked{/if}>
            <input type="radio" name="status" value="2" title="放假中" {if $info.status == 2}checked{/if}>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="note" placeholder="请输入备注" value="{$info.note}" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="form">立即提交</button>
        </div>
    </div>
</form>

<script src="/layui/layui.js"></script>
<script>
    layui.use(['form', 'layer', 'jquery'], function(){
        var form = layui.form;
        var layer = layui.layer;
        var $ = layui.jquery;

        //监听提交
        form.on('submit(form)', function(data){
            $.post('/admin/baseinfo/update', data.field, function (res) {
                if(parseInt(res.code) === 200) {
                    window.parent.closeOpen();
                } else {
                    layer.msg(res.message);
                    return false;
                }
            }, 'json');
            return false;
        });
    });
</script>
</body>
</html>